package com.suian.spring.service.invocation;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class UserServiceCustomInvocationHandler implements InvocationHandler {
    //目标对象
    private Object target;

    public UserServiceCustomInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("customInvocation 方法开始 ");
        Object result = method.invoke(target, args);
        System.out.println("customInvocation 方法结束 ");
        return result;
    }
}
